<!DOCTYPE html>
<html>
	<head>
		<title>雁农冷链平台 - 冷链企业版</title>
		<meta charset="utf-8">
		<link rel="shortcut icon" type="image/x-icon" href="sa-frame/admin-logo.png" class="admin-icon">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
		<link rel="stylesheet" href="sa-frame/index/index.css">
		<link rel="stylesheet" href="sa-frame/index/theme.css">
		<link rel="stylesheet" href="static/sa.css">
	</head>
	<body>
		<!-- App -->
		<div class="app" style="display: none;" :style="'display: block;'" 
			:class="['theme-0', 'theme-' + themeV, (isOpen ? '' : 'app-fold'), (isOpenRight ? '' : 'app-fold-right')]" >
			<!-- 左 -->
			<div class="nav-left">
				<!-- logo部分 -->
				<div class="nav-left-top">
					<nav-logo></nav-logo>
				</div>
				<!-- 左下：菜单 -->
				<div class="nav-left-bottom">
					<nav-menu-bar ref="nav-menu-bar"></nav-menu-bar>
				</div>
			</div>
			<!-- 右 -->
			<div class="nav-right">
				<!-- 工具栏 -->
				<div class="nav-right-1" des="">
					<nav-tool-bar ref="nav-tool-bar"></nav-tool-bar>
				</div>
				<!-- Tab栏 -->
				<div class="nav-right-2">
					<nav-tab-bar ref="nav-tab-bar"></nav-tab-bar>
				</div>
				<!-- 视图容器 -->
				<div class="nav-right-3">
					<nav-view-vessel></nav-view-vessel>
				</div>
			</div>
			<!-- 右键菜单 -->
			<com-right-menu ref="com-right-menu"></com-right-menu>
			<!-- 双击添加新tab -->
			<com-add-tab ref="com-add-tab"></com-add-tab>
		</div>
		
		<!-- js依赖库 -->
		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
		<script type="text/javascript">Vue.config.productionTip = false;</script>
		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.min.js"></script>
		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
		<script src="https://unpkg.com/sortablejs@1.14.0/Sortable.min.js"></script>
		<script src="https://unpkg.com/vuedraggable@2.24.3/dist/vuedraggable.umd.min.js"></script>
		
		<!-- js本地库 -->
		<script src="sa-frame/index/admin-util.js"></script>
		<script src="sa-frame/index/index.js"></script>
		<script src="sa-frame/menu-logistics.js"></script>
		<script src="static/sa.js"></script>
		<script src="sa-frame/sa-code.js"></script>
		
		<script>
			// 调试信息
			console.log('logisticsMenuList 是否已定义:', typeof logisticsMenuList !== 'undefined');
			if (typeof logisticsMenuList !== 'undefined') {
				console.log('logisticsMenuList 内容:', logisticsMenuList);
			}
			
			// 覆盖默认菜单配置为冷链企业菜单
			if (typeof logisticsMenuList !== 'undefined') {
				window.menuList = logisticsMenuList;
				console.log('菜单已设置:', window.menuList);
			} else {
				console.error('logisticsMenuList 未定义!');
			}
			
			// 临时禁用角色检查，确保菜单能显示
			// var userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}');
			// if (userInfo.userRole !== 'logistics') {
			// 	// 如果不是冷链企业角色，跳转到登录页
			// 	location.href = 'login.html';
			// }
			
			// 等待Vue实例创建完成后初始化菜单
			setTimeout(function() {
				if (typeof sa_admin !== 'undefined' && window.menuList && window.menuList.length > 0) {
					console.log('开始初始化菜单，共', window.menuList.length, '个菜单项');
					sa_admin.initMenu(); // 调用菜单初始化函数
					console.log('菜单初始化完成');
				} else {
					console.error('菜单初始化失败 - sa_admin未定义或menuList为空');
				}
			}, 500); // 增加延迟确保Vue实例完全创建
		</script>

	</body>
</html>